module ApplicationHelper
  def display_true_false_field(value, opts = {:centered => true})
    if value
      display_check(opts)
    else
      display_cross(opts)
    end
  end

  def display_check(opts = {})
    if opts[:centered]
      concat(raw("<center>&#x2714;</center>"))
    else
      concat(raw("&#x2714;"))
    end
  end

  def display_cross(opts = {})
    if opts[:centered]
      concat(raw("<center>&#x2715;</center>"))
    else
      concat(raw("&#x2715;"))
    end
  end

  def get_page_specific_javascript(page_title)
    if page_title == "New Event" || page_title == "Edit Event"
      return ['event.js', 'datepicker.js', 'lang/es.js']
    end
    return []
  end
end
